#include <stdio.h>
#include <stdlib.h>
#include <wiiuse/wpad.h>
#include <malloc.h>
#include <ogcsys.h>
#include <gccore.h>
#include <ogc/ipc.h>
#include <stdarg.h>
#include <string.h>

#include "../OnScreenKeyboard.h"

#include <fat.h>
#include <wiisprite.h>

using namespace wsp;

GameWindow gwd;


// Entry point
int main(int argc, char **argv) {
        char* ret_string = "";
	// Initialize filesystem to load from SD Card
	fatInitDefault();

	// Initialize Video
	gwd.InitVideo();

        OnScreenKeyboard* osk;
        //printf("Constructing Keyboard...\n");
        osk = new OnScreenKeyboard(&gwd, "/apps/wiichat/config/key_config.xml");

        //printf("Init WPAD...\n");
	// This function initialises the attached controllers
	WPAD_Init();
	WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
              
        //Make a call to the library
        ret_string = osk->EditString(ret_string);

	return 0;
}

